<div class="layui-fluid">
	<div class="layui-row">
		<div class="">
			<div class="" id="looktop1">

			</div>
		</div>
	</div>

	<div class="jshomttablebox">
		<div class="tabtitle">
			快速菜单
		</div>
		<div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
			<ul class="layui-tab-title">
				<li class="layui-this">概述</li>
				<li>编辑</li>
				<li>报表</li>
			</ul>


			<!-- 概述 -->
			<div class="layui-tab-content">
				<div class="tab">
					<div class="tabbox">
						<div class="layui-row">
							<div class="layui-col-xs12 layui-col-sm6 layui-col-md6 layui-col-lg6">
								<form class="tabbox1 layui-form" id="wjdctabid">

								</form>


							</div>
							<div class="layui-col-xs12 layui-col-sm6 layui-col-md4 layui-col-lg3">

							</div>
						</div>
					</div>
				</div>
			</div>
			<script type="text/html" id="wjdctabhtml">
				<div class="tabboxfl">
										<div class="tabboxl">
											表单创建时间
										</div>
										<div class="tabboxr">
											{{d.createTime}}
										</div>
									</div>
									<div class="tabboxfl">
										<div class="tabboxl">
											填写者权限
										</div>
										<div class="tabboxr">
											{{d.permissionsStatus ==1 ? '所有人可填' : '不可填写' }}
										</div>
									</div>
									<div class="tabboxfl">
										<div class="tabboxl">
											表单开启/停止
										</div>
										<div class="tabboxr">
											已开启，正在收集  <input type="checkbox" name="status"   value="{{d.surveyBaseId}}" lay-skin="switch"  lay-filter="lockDemo" {{ d.status == 1 ? 'checked' : '' }}>
										</div>
									</div>
									<div class="tabboxfl">
										<div class="tabboxl">
											结果分享
										</div>
										<div class="tabboxr">
											<input type="checkbox" name="status"   value="{{d.surveyBaseId}}" lay-skin="switch"  lay-filter="lockDemo" {{ d.shareStatus == 1 ? 'checked' : '' }}>
										</div>
									</div>

			</script>
			<!-- 概述 end -->

			<div class="layui-tab-content">

			</div>
			<div class="layui-tab-content">
				<table id="teachertable" lay-filter="type_hash" lay-even lay-skin="nob"></table>
			</div>

		</div>

	</div>
</div>



<script type="text/html" id="StatusTp1">
	<!-- 类型（1上架，3下架）-->
  <input type="checkbox" name="tbType" value="{{d.id}}" lay-skin="switch"  lay-filter="istopDemo" {{ d.tbType == 1 ? 'checked' : '' }}>
</script>
<!-- 脚本 -->
<script>
	layui.config({
		base: '/src/js/'
	}).use(['jquery', 'mockjs', 'table', 'sidebar', 'form', 'laydate', 'laytpl', 'laypage'], function() {
		var $ = layui.jquery,
			layer = layui.layer,
			table = layui.table,
			sidebar = layui.sidebar,
			form = layui.form,
			laytpl = layui.laytpl,
			laydate = layui.laydate,
			laypage = layui.laypage;
		var router = layui.router();
		form.render('select');
		// 获取主页
		POSTAJAX(QuestionnaireById, {
			tbId: router.search.produstsId
		}, function(res) {
			laytpl($("#wjdctabhtml").html()).render(res.data, function(html) {
				$("#wjdctabid").html(html);
				form.render();

			});
		});
		
		var typetable = table.render({
			size: 'lg',
			where: {
				tbId: router.search.tbId
			},
			id: 'teachertableid',
			contentType: 'application/json',
			pageSize: 20,
			elem: '#teachertable',
			toolbar: '#teachertoolbar',
				height: 'full-100',
			url: HH_URL + QuestionnaireGet1, //数据接口
			page: true, //开启分页
			even: true,
			skin: 'nob',
			cellMinWidth: 100,
			cols: [
				[ //表头
					{
						field:'choose',
						title: '序号',
						width: 50
					},{
						field: 'id',
						title: 'ID',
						hide: true
					}, {
						field: 'tbHeadPortrait',
						title: '封面',
						templet: '#headimgTp',
						event: 'lookheadimg',
						width: 150
					}, {
						field: 'chooseContent',
						title: '标题',
						width: 0,
						style: 'text-align:left',
						sort: true
					},
					{
						field: 'createTime1',
						title: '发布时间',
						width: 200,
						templet: function(d) {
							try {
								console.log(d.createTime.length)
								if (d.createTime.length > 10) {
									return d.createTime.substring(0, 10);
								} else {
									return '无'
								}
							} catch (e) {
								return '无'
							}
						}
					}, {
						field: 'vistnum',
						title: '浏览数量',
						width: 100
					},	{
						type: 'status',
						title: '状态',
						width: 100,
						templet: '#StatusTp',
						unresize: true
					},  {
						title: '操作',
						fixed: 'right',
						width: 200,
						toolbar: '#barteachertable'
					}
				]
			],
		
			done: function(res, curr, cont) {
				// console.log(res)
			
			laydate.render({
				elem: '#dataxx', //指定元素
				range: true,
				done: function(value, date, endDate) {
					if (date.year == undefined) {
						xxjson.startTime = '';
						xxjson.stopTime = '';
					} else {
						xxjson.startTime = date.year + '-' + date.month + '-' + date.date;
						xxjson.stopTime = endDate.year + '-' + endDate.month + '-' + endDate.date;
					}
					typetable.reload({
						where: xxjson,
						page: {
							curr: 1 //重新从第 1 页开始
						}
					});
					cshfn()
				}
			});
			
			form.on('select(shelvesfilter)', function(data) {
				xxjson.shelves = data.value
				typetable.reload({
					where: xxjson,
					page: {
						curr: 1 //重新从第 1 页开始
					}
				});
				cshfn()
			});
			
			
			
		$('#tablesearchid').keydown(function(event) {
			if (event.keyCode == 13) {
				tablesearchidval = $('#tablesearchid').val();
				xxjson.search = tablesearchidval;
				typetable.reload({
					where: xxjson,
					page: {
						curr: 1 //重新从第 1 页开始
					}
				});
				cshfn()
			}
		})
			}
		});



	})
</script>
<!-- 样式 -->
<style scoped>
	.tabbox1 {
		background-color: #ffffff;
		border: solid 1px #dcdfe4;
		padding: 20px 20px;
	}

	.tabboxfl {
		display: flex;
		align-items: center;
		justify-content: space-between;
		font-size: 16px;
		line-height: 3;
	}

	.jshomeback {
		width: 100%;
		background-image: url(../../images/1111.jpg);
		padding-top: 160px;
		height: 265px;
		margin-bottom: 30px;
		border-radius: 5px;
	}

	.jshomebox {
		clear: both;
		display: table;
		width: 100%;
		padding: 49px 31px 0 31px;
		border-radius: 5px;
		margin-bottom: 30px;

	}

	.jshomel {
		width: 160px;
		/* float: left; */
		position: absolute;
		top: 94px;
		left: 55px;
		z-index: 1;

	}

	.jshomehead {
		width: 160px;
		height: 160px;
		border-radius: 50%;
		border: 6px solid #fff;
		background-size: 120% 120%;
		background-position: center center;
	}

	.jshomebot .layui-row {
		max-width: 680px;
	}

	.jshomer {
		padding-left: 232px;
		position: relative;
		background: #fff;
		height: 105px;
		border-radius: 0 0 5px 5px;
	}

	.jshometop {

		position: absolute;
		top: -48px;
		color: #fff;

	}

	.jshomebot {
		padding: 10px 0;
		text-align: center;

	}

	.jstitle {

		color: #71787e;
		font-size: 21px;
		line-height: 2;

	}

	.jstype {
		color: #1875f0;
		display: inline-block;
	}

	.jstype:after {
		content: ' /';

	}

	.jstype:last-child:after {
		content: '';
	}

	.bjbtn {
		width: 98px;
		height: 40px;
		background-color: #1875f0;
		border-radius: 4px;
		font-size: 16px;
		color: #ffffff;
		line-height: 40px;
		margin: 0 auto;
		margin-top: 8px;
	}

	.jshomebot .layui-row>div {
		padding: 15px 0;
		border-right: 1px solid #f6f9fe;
	}

	.jsttext {
		font-size: 18px;
		margin-bottom: 8px;
	}

	.jshomebot .layui-row>div p:last-child {
		font-size: 14px;
		color: #71787e;
	}


	@media (max-width: 1024px) {

		.jshomehead {
			width: 120px;
			height: 120px;

		}

		.jshomel {
			width: 122px;
			/* float: left; */

			top: 83px;
			left: 30px;

		}

		.jshomer {
			padding-left: 152px;

			padding-right: 30px;

			height: 101px;

		}

		.jshomeback {
			width: 100%;
			background-image: url(../../images/1111.jpg);
			padding-top: 129px;
			height: 230px;
			margin-bottom: 1px;
		}

		.jshometop h1 {
			font-size: 21px;
		}

		.jshomebot {
			padding: 0;
		}

		.jsttext {
			font-size: 16px;
			margin-bottom: 8px;
		}

		.bjbtn {
			width: 73px;
			height: 33px;

			font-size: 14px;

			line-height: 35px;
			margin: 0 auto;
			margin-top: 10px;
		}

		.jshomebot .layui-row>div {
			padding: 25px 0;
			border-right: 1px solid #f6f9fe;
		}

		.jshomebot .layui-row>div p:last-child {
			font-size: 14px;
			color: #71787e;
			height: 1.5em;
			overflow: hidden;
			line-height: 1.5;
		}
	}
</style>
